﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PCS_Linh.lab03
{
    class TwoDimentionArray
    {
        public void run()
        {
            Console.Write("Please enter the number of rows: ");
            int n = Convert.ToInt32(Console.ReadLine());
            Console.Write("Please enter the number of columns: ");
            int m = Convert.ToInt32(Console.ReadLine());
            int[,] a = new int[n, m];

            for (int i = 0; i < n; i++)
            {
                Console.WriteLine("Please enter row {0}:", i);
                for (int j = 0; j < m; j++)
                {
                    Console.Write("a[{0},{1}] = ", i, j);
                    a[i, j] = Convert.ToInt32(Console.ReadLine());
                }
            }

            Console.WriteLine("The value of two-deminsion array: ");
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < m; j++)
                {
                    Console.Write("{0,5}", a[i, j]);
                }
                Console.WriteLine();
            }
        }
    }
}
